package gxb.test14;
import java.util.Scanner;

public class AirTicketTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double newPrice;
        while (true) {
            System.out.println("输入机票原价：");
            int oldPrice = sc.nextInt();
            if (oldPrice==-1){
                break;
            }
            System.out.println("输入月份：");
            int mouth = sc.nextInt();
            System.out.println("输入0则为头等舱1则为经济舱：");
            int wareHouse = sc.nextInt();//仓位
            if (mouth > 4 && mouth < 11) {
                System.out.println("旺季");
                if (wareHouse == 1) {
                    newPrice = oldPrice * (0.85);
                    System.out.print("经济舱");
                } else {
                    newPrice = oldPrice * (0.9);
                    System.out.print("头等舱");
                }
            } else {
                System.out.println("淡季");
                if (wareHouse == 1) {
                    System.out.print("经济舱");
                    newPrice = oldPrice * (0.65);
                } else {
                    newPrice = oldPrice * (0.7);
                    System.out.print("头等舱");
                }
            }
            System.out.println("票价为" + newPrice);
        }
    }
}